﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MockPrjTeam2.Biz
{
    public class MyCustomException : Exception
    {

        /// <summary>
        /// Initializes a new instance of the <see cref="MyCustomException"/> class.
        /// </summary>
        /// <param name="methodName">Name of the method.</param>
        /// <param name="customMessage">The custom message.</param>
        /// <param name="ex">The ex.</param>
        public MyCustomException(string methodName, string customMessage, Exception ex)
        {
            this.CustomMessage = customMessage;
            this.MachineName = Environment.MachineName;
            this.MethodName = methodName;
            this.OriginalException = ex;
        }

        /// <summary>
        /// Gets the custom message.
        /// </summary>
        public string CustomMessage { get; private set; }

        /// <summary>
        /// Gets or sets the name of the user.
        /// </summary>
        /// <value>
        /// The name of the user.
        /// </value>
        public string UserId { get; set; }

        /// <summary>
        /// Gets or sets the user ip.
        /// </summary>
        /// <value>
        /// The user ip.
        /// </value>
        public string UserIp { get; set; }

        /// <summary>
        /// Gets the name of the method.
        /// </summary>
        /// <value>
        /// The name of the method.
        /// </value>
        public string MethodName { get; private set; }

        /// <summary>
        /// Gets the name of the machine.
        /// </summary>
        /// <value>
        /// The name of the machine.
        /// </value>
        public string MachineName { get; private set; }

        /// <summary>
        /// Gets or sets the original exception.
        /// </summary>
        /// <value>
        /// The original exception.
        /// </value>
        public Exception OriginalException { get; set; }
    }
}